﻿using System;
using System.Xml.Linq;

namespace RenRen.Utility
{
    ///<summary>
    ///</summary>
    public static  class TypeExtentions
    {
        ///<summary>
        ///</summary>
        ///<param name="response"></param>
        ///<returns></returns>
        public static Type GetResponseObjectType(this string response)
        {
            XDocument doc = XDocument.Parse(response);
            return doc.Root == null ? null : Type.GetType("RenRen.Schema." + doc.Root.Name.LocalName);
        }
    }
}
